{extends file='layout/main.html'}
{block name="main"}

<div class="main_title">
	<h2>未打印订单-列表</h2>
	<p>{$model_info.detail}</p>
</div>


<table width="100%" class="table_list">
	<tr>
		{foreach $attribute as $val}
			{if !$val.is_hide}
				<th>{$val.name}</th>
			{/if}
		{/foreach}
		
		<th width="150">添加时间</th>
		<th width="80">操作</th>
	</tr>
	
	{foreach $data as $val}
	<tr{if $val@iteration % 2} class="odd"{/if}>
			{foreach $attribute as $v}
				{if !$v.is_hide}
  				{if $v.type == 'model'}
  				  {if $v.name == '订单状态'}
  				  <td>
                      <a href="javascript:;" onclick="">{get_attribute_value(get_attribute_value($val.id, $v.name), $v['value'][1])}</a>
                  </td>
  				  {elseif $v.name == '操作人'}
  				  <td>
            <a href="?url=user_manage&res_id={get_attribute_value($val.id, $v.name)}">{get_attribute_value(get_attribute_value($val.id, $v.name), $v['value'][1])}</a>
            </td>
  				  {elseif $v.name == '调查表'}
  				  <td>
                      <a href="?url=feedback_manage&res_id={get_attribute_value($val.id, $v.name)}">{get_attribute_value(get_attribute_value($val.id, $v.name), $v['value'][1])}</a>
                  </td>
  				  {else}
  				  <td>
                      <a href="?url=resource&res_id={get_attribute_value($val.id, $v.name)}">{get_attribute_value(get_attribute_value($val.id, $v.name), $v['value'][1])}</a>
                  </td>
  				  {/if}
  				{else}
  				  <td>{substr_fix(get_attribute_value($val.id, $v.name), 30)}</td>
  				{/if}	
  			{/if}
			{/foreach}
		<td>{date('Y-m-d h:i:s', $val.add_time)}</td>
		<td><a href="javascript:;" onclick="doprint({get_attribute_value($val.id, $v.name)})">打印</td>
	</tr>
	{/foreach}
</table>


<script type="text/javascript" charset="utf-8">

function doprint(id)
{
  $.get('?url=print_manage/doprint&id='+id, function(out){
      var w = window.open('/step3.html?id='+id);
      w.print();
      w.close();
      window.location.reload();
  });
}

</script>

{/block}